﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Data.SqlClient;


/// <summary>
/// Summary description for clsBIENLAI
/// </summary>
public class clsBIENLAI
{
	public clsBIENLAI()
	{

    }

    #region Insert
    public static string Insert(Guid F_STT, string F_MACN, string F_MASO, int F_THANG, int F_NAM)
    {
        DatabaseConnect connect = new DatabaseConnect();
        SqlParameter[] para = new SqlParameter[5];
        para[0] = new SqlParameter("@F_STT", F_STT);
        para[1] = new SqlParameter("@F_MACN", F_MACN);
        para[2] = new SqlParameter("@F_MASO", F_MASO);        
        para[3] = new SqlParameter("@F_THANG", F_THANG);
        para[4] = new SqlParameter("@F_NAM", F_NAM);
        try
        {
            connect.ExecuteQuery("BIENLAI_Insert", para);
            return "OK";
        }
        catch
        {
            return "ERR";
        }
    }
    #endregion

    public DataTable getByF_STT(Guid F_STT)
    {
        SqlParameter[] para = new SqlParameter[1];
        para[0] = new SqlParameter("@F_STT", F_STT);
        DataTable dt = new DataTable();
        DatabaseConnect connect = new DatabaseConnect();
        try
        {
            dt = connect.GetSelectCommand("BIENLAI_GetByF_STT", para);
        }
        catch
        {
            dt = null;
        }
        return dt;
    }
}